﻿<Window x:Class="Visuals.SearchPreview"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Търсене" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="487" Width="946">
    <Grid x:Name="mainGrid">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300" />
            <ColumnDefinition Width="624*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="195*"/>
            <RowDefinition Height="195*"/>
        </Grid.RowDefinitions>
        <RichTextBox x:Name="richTextBoxPreview" IsReadOnly="True" Margin="9,46,7,9" Grid.Column="1" Grid.RowSpan="2" VerticalScrollBarVisibility="Visible" KeyDown="richTextBoxPreview_KeyDown" 
                     SelectionChanged="richTextBoxPreview_SelectionChanged">
            <RichTextBox.ContextMenu>
                <ContextMenu x:Name="contextMenu">
                    <MenuItem Header="Добави като субект" Icon="Images/Green.png" Click="MenuItem_Click" />
                </ContextMenu>
            </RichTextBox.ContextMenu>
        </RichTextBox>
            <ListView x:Name="listViewDocuments" Margin="10,45,11,5" MouseDoubleClick="listViewDocuments_MouseDoubleClick" >
            <ListView.View>
                <GridView>
                    <GridViewColumn x:Name="Id" Header="№" Width="30" DisplayMemberBinding="{Binding Key}"></GridViewColumn>
                    <GridViewColumn x:Name="Doc" Header="Документ" Width="150" DisplayMemberBinding="{Binding Value}"></GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
            <ListView x:Name="listView" Margin="0,30,11,10" Grid.Row="1" SelectionChanged="listViewResults_SelectionChanged" >
            <ListView.View>
                <GridView>
                    <GridViewColumn x:Name="Category" Header="Кат." Width="50" DisplayMemberBinding="{Binding Value}">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <ComboBox>
                                    <ComboBoxItem Content="1"></ComboBoxItem>
                                    <ComboBoxItem Content="2"></ComboBoxItem>
                                </ComboBox>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn x:Name="Entity" Header="Субект" Width="250" DisplayMemberBinding="{Binding Key}"></GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
            <TextBox x:Name="textBoxSearchBox" HorizontalAlignment="Left" Margin="12,18,0,0" VerticalAlignment="Top" Width="277" KeyDown="textBoxSearchBox_KeyDown" />
        <Button Content="Изтрий" Height="23" HorizontalAlignment="Right" Margin="0,0,11,0" Name="deleteEntity" VerticalAlignment="Top" Width="90" Click="deleteEntity_Click" Grid.Row="1">
            <Button.ToolTip>
                <ToolTip>
                    <TextBlock>Изтрий текущия избран реално съществуващ обект от списъка.</TextBlock>
                </ToolTip>
            </Button.ToolTip>
        </Button>
        <Button Content="Добави" Height="23" HorizontalAlignment="Right" Margin="0,17,7,0" Name="addEntity" VerticalAlignment="Top" Width="90" Click="addEntity_Click" Grid.Column="1">
            <Button.ToolTip>
                <ToolTip>
                    <TextBlock>Добави селекцията като реално съществуващ обект.</TextBlock>
                </ToolTip>
            </Button.ToolTip>
        </Button>
        <TextBox Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="178,18,0,0" Name="tbCurrentSelection" VerticalAlignment="Top" Width="343" Text="" />
        <ComboBox Height="23" HorizontalAlignment="Left" Margin="10,0,0,0" Name="comboBoxCategory" VerticalAlignment="Top" Width="120" Grid.Row="1" SelectionChanged="comboBoxCategory_SelectionChanged">
            <ComboBoxItem Content="0"></ComboBoxItem>
            <ComboBoxItem Content="1"></ComboBoxItem>
            <ComboBoxItem Content="2"></ComboBoxItem>
        </ComboBox>
    </Grid>
</Window>
